package cn.candy.sys.service.impl;

import cn.candy.basic.service.impl.BaseServiceImpl;
import cn.candy.sys.domain.DictionaryType;
import cn.candy.sys.mapper.DictionaryDetailMapper;
import cn.candy.sys.service.IDictionaryTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 数据字典类型业务实现类
 */
@Service
public class DictionaryTypeServiceImpl extends BaseServiceImpl<DictionaryType> implements IDictionaryTypeService {

    @Autowired
    private DictionaryDetailMapper dictionaryDetailMapper;

    @Override
    public void del(Long id) {
        //根据数据字典类型id - 删除数据字典类型
        super.del(id);
        //根据数据字典类型id - 删除数据字典明细
        dictionaryDetailMapper.delByTypeId(id);
    }


    @Override
    public void batchRemove(List<Long> ids) {
        //根据数据字典类型id - 批量删除数据字典类型
        super.batchRemove(ids);
        //根据数据字典类型ids - 批量删除数据字典明细
        dictionaryDetailMapper.batchDelByTypeIds(ids);
    }
}
